# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.676.14.51 -> 1.676.14.52 # include/linux/sched.h 1.33 -> 1.34 # kernel/sched.c 1.30 -> 1.31 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/09/27 bjorn_helgaas@hp.com 1.676.14.52 # Correct CPU bitmask truncation to 32-bits. # -------------------------------------------- # diff -Nru a/include/linux/sched.h b/include/linux/sched.h --- a/include/linux/sched.h Wed Oct 8 09:07:43 2003 +++ b/include/linux/sched.h Wed Oct 8 09:07:43 2003 @@ -482,8 +482,8 @@ policy: SCHED_OTHER, \ mm: NULL, \ active_mm: &init_mm, \ - cpus_runnable: -1, \ - cpus_allowed: -1, \ + cpus_runnable: ~0UL, \ + cpus_allowed: ~0UL, \ run_list: LIST_HEAD_INIT(tsk.run_list), \ next_task: &tsk, \ prev_task: &tsk, \ diff -Nru a/kernel/sched.c b/kernel/sched.c --- a/kernel/sched.c Wed Oct 8 09:07:43 2003 +++ b/kernel/sched.c Wed Oct 8 09:07:43 2003 @@ -116,7 +116,7 @@ #define idle_task(cpu) (init_tasks[cpu_number_map(cpu)]) #define can_schedule(p,cpu) \ - ((p)->cpus_runnable & (p)->cpus_allowed & (1 << cpu)) + ((p)->cpus_runnable & (p)->cpus_allowed & (1UL << cpu)) #else @@ -359,7 +359,7 @@ if (task_on_runqueue(p)) goto out; add_to_runqueue(p); - if (!synchronous || !(p->cpus_allowed & (1 << smp_processor_id()))) + if (!synchronous || !(p->cpus_allowed & (1UL << smp_processor_id()))) reschedule_idle(p); success = 1; out: